﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ColliderTrigger : MonoBehaviour
{
    Collider m_Col;
    public Collider col => m_Col;

    public Action<ColliderTrigger,Collider> onTriggerEnter;
    public Action<ColliderTrigger,Collider> onTriggerStay;
    public Action<ColliderTrigger,Collider> onTriggerExit;
    public Action<ColliderTrigger,Collider> onCollisionEnter;
    public Action<ColliderTrigger,Collider> onCollisionStay;
    public Action<ColliderTrigger,Collider> onCollisionExit;

    private void Awake()
    {
        m_Col = GetComponent<Collider>();
    }
    // Start is called before the first frame update
    void Start()
    {
        
    }

    private void OnTriggerEnter(Collider other)
    {
        onTriggerEnter?.Invoke(this,other);
    }
    private void OnTriggerStay(Collider other)
    {
        onTriggerStay?.Invoke(this, other);
    }
    private void OnTriggerExit(Collider other)
    {
        onTriggerExit?.Invoke(this, other);
    }

    private void OnCollisionEnter(Collision other)
    {
        onCollisionEnter?.Invoke(this, other.collider);
    }
    private void OnCollisionStay(Collision other)
    {
        onCollisionStay?.Invoke(this, other.collider);
    }
    private void OnCollisionExit(Collision other)
    {
        onCollisionExit?.Invoke(this, other.collider);
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
